package pl.edu.agh.inpema.components.receivers.phpBB2Receiver.model;

import org.htmlparser.Node;

public class HtmlPost {

	private String login;
	private Node details;
	private Node body;
	
	public HtmlPost(String login, Node details, Node body) {
		this.login = login;
		this.details = details;
		this.body = body;
	}

	public String getLogin() {
		return login;
	}
	public void setLogin(String login) {
		this.login = login;
	}
	public Node getDetails() {
		return details;
	}
	public void setDetails(Node details) {
		this.details = details;
	}
	public Node getBody() {
		return body;
	}
	public void setBody(Node body) {
		this.body = body;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((body == null) ? 0 : body.hashCode());
		result = prime * result + ((details == null) ? 0 : details.hashCode());
		result = prime * result + ((login == null) ? 0 : login.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		HtmlPost other = (HtmlPost) obj;
		if (body == null) {
			if (other.body != null)
				return false;
		} else if (!body.equals(other.body))
			return false;
		if (details == null) {
			if (other.details != null)
				return false;
		} else if (!details.equals(other.details))
			return false;
		if (login == null) {
			if (other.login != null)
				return false;
		} else if (!login.equals(other.login))
			return false;
		return true;
	}
}
